<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>工业成品仓RFID进出库管理系统</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">

    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">
    <link rel="shortcut icon" href="./favicon.ico" mce_href="./favicon.ico" type="image/x-icon">
    <!-- load css -->
    <link rel="stylesheet" href="./static/layui-v1.0.9_rls/layui/css/layui.css">
    <link rel="stylesheet" href="./static/css/global.css">
    <link rel="stylesheet" href="./static/css/adminstyle.css">
    <style>
        .lock-box {
            background: rgba(255, 255, 255, .3);
            padding: 20px;
            border-radius: 3px;
            -webkit-border-radius: 3px;
            position: relative;
            height: 190px;
        }

        .native-a{
            text-decoration: underline;
            color: #5557ff;
        }
        .native-a:hover{
            text-decoration: none;
            color: blue;
        }
    </style>

</head>
<body>


<!-- 加载js文件-->
<script src="./static/layui-v1.0.9_rls/layui/layui.js"></script>
<!-- 锁屏 -->
<div class="lock-screen">
    <div id="locker" class="lock-wrapper">
        <div id="time"></div>
        <div class="lock-box center" style="width: 400px;height: 300px;">
            <img src="./static/images/userimg.png" alt="XXX系统" style="margin-left: 20px;width: 100px;height: 100px;">
            <h1>工业成品仓RFID进出库管理系统</h1>
            <duv class="form-group col-lg-12">
                <form class="layui-form" action="">
                    <div class="layui-form-item">
                        <label class="layui-form-label">用户名</label>
                        <div class="layui-input-block" style="margin-right: 60px;"  id="xxxx">
                            <input type="text" name="name" required lay-verify="required" placeholder="请输用户名"
                                   autocomplete="off"
                                   class="layui-input">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">密码</label>
                        <div class="layui-input-block" style="margin-right: 60px;">
                            <input type="password" name="password" required lay-verify="required" placeholder="请输密码"
                                   autocomplete="off"
                                   class="layui-input">
                        </div>
                    </div>


                    <div class="layui-form-item">
                        <div class="layui-input-block">

                            <button class="layui-btn" lay-submit lay-filter="adp-merge-btn" style="margin-right: 80px;">
                                登录
                            </button>

                        </div>
                        <br/>
                        <a class="native-a" href="register.html" style="padding-left: 25px;">注册</a>
                    </div>
                </form>
            </duv>
        </div>
    </div>
</div>
</body>
</html>
<script>
    layui.define(['jquery', 'layer', 'element', 'laypage', 'form', 'laytpl'], function (exports) {
        var $ = layui.jquery;
        var layer = layui.layer;

        var laytpl = layui.laytpl;
        var element = layui.element();
        var laypage = layui.laypage;
        var form = layui.form();


        form.on("submit(adp-merge-btn)", function (data) {
            var field = data.field;
            var maskid = layer.load();
            $.post({
                contentType: "application/json; charset=utf-8",
                url: "./rs/Login/login",
                data: JSON.stringify(field)


            }).error(function (data) {
                layer.msg(data.responseText);

            }).success(function (data) {
                if(data) {
                    window.location.href = "./index.html";;
                }else{
                    layer.tips("用户名或密码错误!", '#xxxx', {
                        tips: [2, 'red']
                    });
                }

            }).always(function (data) {

                layer.close(maskid);

            });


            return false;//阻止form提交
        });




    });
</script>